<div class='fui-page fui-page-current member-log-page'>
    <div class='fui-content'>
		<div class="fui-tab fui-tab-success">
			<a ng-class="{'active':pagedata.params.status==0}" class="external" href="javascript:;" ng-click="pagedata.params.status=0;tool.get_list('/worker_goods.log/list/',true)">待支付</a>
			<a ng-class="{'active':pagedata.params.status==1}" class="external" href="javascript:;" ng-click="pagedata.params.status=1;tool.get_list('/worker_goods.log/list/',true)">已支付</a>
			<a ng-class="{'active':pagedata.params.status==2}" class="external" href="javascript:;" ng-click="pagedata.params.status=2;tool.get_list('/worker_goods.log/list/',true)">已使用</a>
		</div>
        <div class='content-empty' ng-show="!pagedata.list || pagedata.list.length<=0">
            <i class='fa fa-comment-o'></i><br/>暂时没有任何在线记录!
        </div>
        <div class='fui-list-group container'>
			<div class="fui-list goods-item" ng-repeat="item in pagedata.list">
				<div class="fui-list-inner">
					<div class='title'>
						<span>{{item.goods.title}}</span>
					</div>
					<div class='title'>
						<span ng-show="item.ispay==1" class="label label-success">{{item.statustitle}}</span>
						<span ng-show="item.ispay!=1" class="label label-danger">{{item.statustitle}}</span>
						<span class="red" style="margin-left:0.3rem">￥{{item.money}}</span>
						<span class="gray" style="margin-left:0.3rem">剩余{{item.lasttimes}}次</span>
					</div>
					<div class='gray'>{{item.ordersn}}</div>
					<div class='gray' style="font-size:0.6rem">{{item.createtime}}</div>
				</div>
				<div class='fui-list-angle'>
					<span ng-show="item.status==1" ng-click="pagedata.show_verify(item.hexiaourl,item.ordersn)" class='btn btn-sm btn-gray'>核销</span>
					<span ng-show="item.status==0" ng-click="pagedata.pay_submit(item.id)" class='btn btn-sm btn-info'>立即支付</span>
				</div>
			</div>
		</div>
    </div>
</div>
<div ng-if="pagedata.showewm" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="width:70%">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showewm=false"></i>
			<div class="code_box c" style="padding:0.5rem">
				<p style="padding:0.5rem">请将二维码出示给大夫</p>
				<div class="img_box" id="show_verify_ewm">
					
				</div>
				<div class="cav_code" id="show_verify_code"></div>
				<div class="gray">
					<p>温馨提示：为了更好的保护您利益,请不要轻易将您的核销二维码泄露给他人</p>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('common/pluginnav')"></div>
<script>
scope.pagedata.show_verify=function(url,code){
	scope.tool.qr(url,'show_verify_ewm',150)
	$('#show_verify_code').text(code);
	scope.pagedata.showewm=true
	scope.$evalAsync();
}	
scope.tool.get_list('/worker_goods.log/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('/worker_goods.log/list/');
}
scope.pagedata.pay_submit=function(id){
	scope.post_json('/worker_goods/twopay/id='+id,{},function(pay_id){
		scope.tool.pay(pay_id,function(res){
				if(res.type=='success'){
					scope.message(res.message,'success','/worker_goods.log/');
				}else{
					scope.message(res.message,'success','/worker_goods.log/');
				}
		},'','','/worker_goods.log/','/worker_goods.log/');
	});
}
</script>